import type { VNode, ComponentInternalInstance } from "vue";

// message props
export interface MessageProps {
    message?: string | VNode;
    duration?: number;
    type?: 'success' | 'warning' | 'info' | 'error';
    showClose?: boolean;
    onDestory: () => void;
    offset?: number;
    id: string;
    zIndex: number;
    transitionName?: string;
}

// message instances manage type
export interface MessageContext {
    id: string;
    vm: ComponentInternalInstance;
    vnode: VNode;
    props: MessageProps;
    destory: () => void;
}

// method type
export type CreateMessageProps = Omit<MessageProps, 'onDestory' | 'id' | 'zIndex'>;

